﻿// Create user extensions namespace (Ext.ux)
Ext.namespace('Ext.ux');

/**
* Ext.ux.SissonixPanel Extension Class
*
* @author Mark Sisson
* @version 1.0
*
* @class Ext.ux.SissonixPanel
* @extends Ext.form.FormPanel
* @constructor
* @param {Object} config Configuration options
*/
Ext.ux.SissonixPanel = function(config) {
    //These are standard defaults that define the Sissonix Panel.
    config.monitorValid = true;
    config.autoHeight = false;
    config.labelAlign = 'right';
    config.frame = false;  //this is the blue background
    config.defaults = (config.defaults || {});
    config.defaults.style = 'margin-top:2px; margin-bottom; 2px;';
    config.defaults.msgTarget = 'under';

    // call parent constructor
    Ext.ux.SissonixPanel.superclass.constructor.call(this, config);

    //the form variable of the PanelForm is actually a pointer
    //to the BasicForm parent.
    this.form.isValid(); //trigger validation on all fields.
};

//Now extend from FormPanel.
Ext.extend(Ext.ux.SissonixPanel, Ext.form.FormPanel, {});